import first from '../../components/first.vue'
import like from '../../components/like.vue'
import buy from '../../components/buy.vue'
import reg from '../../components/reg.vue'
import details from '../../components/details.vue'
import my from '../../components/my.vue'
import shoplist from '../../components/shoplist.vue'

import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

export default new VueRouter({
    routes: [
        {
            path: '/',
            component: first,
            children: [
                {
                    path: '/like',
                    component: like
                },
                {
                    path: '/buy',
                    component: buy
                },
                // {
                //     path: '/shoplist',
                //     component: shoplist
                // },
            ],
            //重定向
            redirect:'/like'
        },
        {
            path: '/details/:msg',
            component: details
        },
        {
            path: '/my',
            component: my,
        },
        
        {
            path: '/reg',
            component: reg
        },
        //重定向 path不存在那么跳转到redirect
        {
            path: '/*',
            redirect: '/like'
        }

    ]
})